#ifndef __MP_LOGGER_H__
#define __MP_LOGGER_H__

#include <log4cplus/logger.h>
#include <log4cplus/loggingmacros.h>

enum LoggerLevelEnum {
    LOG_LEVEL_TRACE = 0,
    LOG_LEVEL_DEBUG = 10000,
    LOG_LEVEL_INFO  = 20000,
    LOG_LEVEL_WARN  = 30000,
    LOG_LEVEL_ERROR = 40000,
    LOG_LEVEL_FATAL = 50000,
};

#define mp_log_trace LOG4CPLUS_TRACE_FMT
#define mp_log_debug LOG4CPLUS_DEBUG_FMT
#define mp_log_info  LOG4CPLUS_INFO_FMT
#define mp_log_warn  LOG4CPLUS_WARN_FMT
#define mp_log_error LOG4CPLUS_ERROR_FMT
#define mp_log_fatal LOG4CPLUS_FATAL_FMT

#define DEFAULT_LOGGER Logger::get_instance()->get_logger()

class Logger {
private:
    Logger();
    ~Logger();

public:
    static Logger *get_instance();
    static void loglevel(LoggerLevelEnum loglevel);
    static void logname(std::string logname);

    log4cplus::Logger& get_logger();
    void set_logger(log4cplus::Logger&& logger);

private:
    //log4cplus::Initializer m_initializer;
    log4cplus::Logger m_logger;
};

#endif
